[CU-19bjtt] Rating text color is variable#89
[CU-19bjtt] Rating text color is variable#89sanyud24 wants to merge 9 commits intocheckin-team:developfrom sanyud24:sa_branch
Conversation
textview rating color changes on the basis of rating
| } else "-" | ||
| } ?: "-" | ||
| tvRating.text = restaurantModel.formatRating() | ||
| val ratingtext: String = tvRating.text.toString(); |
There was a problem hiding this comment.
Why don't you use restaurantModel.rating on RHS of assignment? Then you don't need to cover it back to float.
updated public restaurant rating color
shivanshs9
left a comment
There was a problem hiding this comment.
@sanyud24 please check that CI check is failing for this PR.
That means this PR code cannot even build. Please fix it by running your code on your phone locally before pushing the code.
|
Task linked: CU-19bjtt Rating text color is variable |
shivanshs9
left a comment
There was a problem hiding this comment.
What's the point of deduplicating code if you're still writing same if-else block twice? 🙄
Plus, I mentioned creating the extension functions on the data classes so you don't need to pass data.ratings explicitly. And the function will return the color integer value (like R.color.apple_green) rather than setting it on its own.
couldnt figure out where to call the function
|
Superseded by #101 |
textview rating color changes on the basis of rating